let regNumStr = /(?<number>-?\d+(?:\.\d+)?)\D*/;
/**
 * 返回 含数字开头字符串的开头 数字
 * @param {String} str 含数字开头的字符串
 * @returns {Number}
 */
function getNum(str) {
  let exc = regNumStr.exec(str);
  return exc == null ? NaN : Number(exc['groups']['number']);
}
export { getNum };
